package com.lwx.png;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class CheBiaoMain {
    public static void main(String[] args) throws Exception {
        //File directory = new File("F:\\360Downloads\\Apk\\猜车标达人 1.3.6\\assets\\data");
        File directory = new File("F:\\360Downloads\\Apk\\猜车标达人 1.3.6\\assets");
        for(File pngFile : directory.listFiles()){
            if(pngFile.getName().endsWith("png")){
                //File newFile = new File("F:\\chebiao\\" + pngFile.getName());
                File newFile = new File("F:\\chebiao\\ui\\" + pngFile.getName());
                FileOutputStream fos = new FileOutputStream(newFile);
                fos.write(0x89);
                fos.write(0x50);
                fos.write(0x4E);
                fos.write(0x47);
                fos.write(0x0D);
                fos.write(0x0A);
                fos.write(0x1A);
                fos.write(0x0A);
                fos.write(0x00);
                fos.write(0x00);
                fos.write(0x00);
                fos.write(0x0D);
                fos.write(0x49);
                fos.write(0x48);
                fos.write(0x44);
                fos.write(0x52);
                
                FileInputStream fis = new FileInputStream(pngFile);
                fis.skip(16);
                
                int temp = 0;
                while((temp = fis.read()) != -1){
                    fos.write(temp);
                }
                
                fis.close();
                fos.close();
            }
        }
    }

}
